package com.blb.eduadservice.controller;

import com.blb.common.entity.PromotionAd;
import com.blb.common.util.ResponseResult;
import com.blb.eduadservice.service.IPromotionAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * <p>
 * 广告表 前端控制器
 * </p>
 *
 * @author xray
 * @since 2023-03-30
 */
@Controller
@RequestMapping("/promotionAd")
public class PromotionAdController {

    @Autowired
    private IPromotionAdService promotionAdService;

    @GetMapping
    public ResponseResult<List<PromotionAd>>getOrderById(@PathVariable String id){
        List<PromotionAd> promotionAds = promotionAdService.selectBySpaceId(id);
        return ResponseResult.ok(promotionAds);
    }


}
